#include "vec3.h"

vec3::vec3(float x, float y, float z)
{
    this->x = x;
    this->y = y;
    this->z = z;
}

vec3::vec3()
{
    x = 0;
    y = 0;
    z = 0;
}

vec3::~vec3()
{
    //dtor
}

vec3& vec3::operator*(const vec3 &vec)
{
    this->x *= vec.x;
    this->y *= vec.y;
    this->z *= vec.z;
    return (*this);
}

vec3& vec3::operator+(const vec3 &vec)
{
    this->x += vec.x;
    this->y += vec.y;
    this->z += vec.z;
    return (*this);
}

vec3& vec3::operator*(int i)
{
    this->x *= i;
    this->y *= i;
    this->z *= i;
    return (*this);
}

vec3& vec3::operator+(int i)
{
    this->x += i;
    this->y += i;
    this->z += i;
    return (*this);
}

vec3& vec3::operator*(float i)
{
    vec3 t;
    t.x = this->x * i;
    t.y = this->y * i;
    t.z = this->z * i;
    return (t);
}

vec3& vec3::operator+(float i)
{
    vec3 t;
    t.x = this->x + i;
    t.y = this->y + i;
    t.z = this->z + i;
    return (t);
}

std::ostream &operator<<(std::ostream &out, const vec3 &vec)
{
    out << "x : " << vec.x << " y : " << vec.y << " z : " << vec.z;
    return (out);
}
